//-----------------------------------------------------------------------------
// Name: Dude.cpp
// Auth: Bradford J. Smith & Robert Darty
// Desc: Moves a truck around in 2D
//-----------------------------------------------------------------------------

#include "RobTown.h"

#include "SharedConstants.h"

#include "corona/corona.h"

#include <GL/glut.h>
#include <math.h>

//-----------------------------------------------------------------------------
// Globals:
//-----------------------------------------------------------------------------
cRobTown gRobTown;


//-----------------------------------------------------------------------------
// Functions:
//-----------------------------------------------------------------------------
cRobTown* GetRobTown()
{
	return &gRobTown;
}

//-----------------------------------------------------------------------------
// class cDude:
//-----------------------------------------------------------------------------
cRobTown::cRobTown() :
	mXPosition(0),
	mZPosition(0)
{

}

cRobTown::~cRobTown()
{
}

void cRobTown::Move(int x, int z)
{
	mXPosition = x;
	mZPosition = z;
}

void cRobTown::Draw()
{
	glBegin(GL_QUADS);

	glColor3f( 0.96f, 0.64f, 0.39f );

	glVertex3f( 250.0f, 0, 250.0f );
	glVertex3f( 250.0f, 0, -250.0f );
	glVertex3f( -250.0f, 0, -250.0f );
	glVertex3f( -250.0f, 0, 250.0f );
	

	glEnd();

	glBegin( GL_QUADS );

	//perimeter roads
	glColor3f( 0.5f, 0.5f, 0.5f );
	glVertex3f( 250.0f, 0.01f, -240.0f );
	glVertex3f( 250.0f, 0.01f, -250.0f );
	glVertex3f( -250.0f, 0.01f, -250.0f );
	glVertex3f( -250.0f, 0.01f, -240.0f );

	glVertex3f( -240.0f, 0.01f, -240.0f );
	glVertex3f( -250.0f, 0.01f, -240.0f );
	glVertex3f( -250.0f, 0.01f, 250.0f );
	glVertex3f( -240.0f, 0.01f, 250.0f );

	glVertex3f( -240.0f, 0.01f, 240.0f );
	glVertex3f( -240.0f, 0.01f, 250.0f );
	glVertex3f( 250.0f, 0.01f, 250.0f );
	glVertex3f( 250.0f, 0.01f, 240.0f );

	glVertex3f( 240.0f, 0.01f, 240.0f );
	glVertex3f( 250.0f, 0.01f, 240.0f );
	glVertex3f( 250.0f, 0.01f, -240.0f );
	glVertex3f( 240.0f, 0.01f, -240.0f );

	//town square
	glVertex3f( 30.0f, 0.01f, 30.0f );
	glVertex3f( 30.0f, 0.01f, -30.0f );
	glVertex3f( -30.0f, 0.01f, -30.0f );
	glVertex3f( -30.0f, 0.01f, 30.0f );

	//roads to town square
	glVertex3f( 240.0f, 0.01f, 5.0f );
	glVertex3f( 240.0f, 0.01f, -5.0f );
	glVertex3f( 30.0f, 0.01f, -5.0f );
	glVertex3f( 30.0f, 0.01f, 5.0f );

	glVertex3f( -30.0f, 0.01f, 5.0f );
	glVertex3f( -30.0f, 0.01f, -5.0f );
	glVertex3f( -240.0f, 0.01f, -5.0f );
	glVertex3f( -240.0f, 0.01f, 5.0f );

	glVertex3f( -5.0f, 0.01f, -30.0f );
	glVertex3f( 5.0f, 0.01f, -30.0f );
	glVertex3f( 5.0f, 0.01f, -240.0f );
	glVertex3f( -5.0f, 0.01f, -240.0f );

	glVertex3f( 5.0f, 0.01f, 30.0f );
	glVertex3f( -5.0f, 0.01f, 30.0f );
	glVertex3f( -5.0f, 0.01f, 240.0f );
	glVertex3f( 5.0f, 0.01f, 240.0f );

	//other roads bottom half
	glVertex3f( 240.0f, 0.01f, 90.0f );
	glVertex3f( 240.0f, 0.01f, 80.0f );
	glVertex3f( -240.0f, 0.01f, 80.0f );
	glVertex3f( -240.0f, 0.01f, 90.0f );

	glVertex3f( 240.0f, 0.01f, 170.0f );
	glVertex3f( 240.0f, 0.01f, 160.0f );
	glVertex3f( -240.0f, 0.01f, 160.0f );
	glVertex3f( -240.0f, 0.01f, 170.0f );

	//other roads top half
	glVertex3f( 240.0f, 0.01f, -80.0f );
	glVertex3f( 240.0f, 0.01f, -90.0f );
	glVertex3f( -240.0f, 0.01f, -90.0f );
	glVertex3f( -240.0f, 0.01f, -80.0f );

	glVertex3f( 240.0f, 0.01f, -160.0f );
	glVertex3f( 240.0f, 0.01f, -170.0f );
	glVertex3f( -240.0f, 0.01f, -170.0f );
	glVertex3f( -240.0f, 0.01f, -160.0f );

	glEnd();
	/*

	//left foot
	//front
	glVertex3f( 0.2f, 0, 0 );
	glVertex3f( 0.2f, 0.15f, 0 );
	glVertex3f( 0.2f, 0.15f, 0.2f );
	glVertex3f( 0.2f, 0, 0.2f );

	//left-side
	glVertex3f( 0.2f, 0, 0.2f );
	glVertex3f( 0.2f, 0.15f, 0.2f );
	glVertex3f( -0.1f, 0.15f, 0.2f );
	glVertex3f( -0.1f, 0, 0.2f );
	//right side
	glVertex3f( 0.2f, 0, 0 );
	glVertex3f( -0.1f, 0, 0 );
	glVertex3f( -0.1f, 0.15f, 0 );
	glVertex3f( 0.2f, 0.15f, 0 );
	//top
	glVertex3f( 0.2f, 0.15f, 0.2f );
	glVertex3f( 0.2f, 0.15f, 0 );
	glVertex3f( -0.1f, 0.15f, 0 );
	glVertex3f( -0.1f, 0.15f, 0.2f );
	//back
	glVertex3f( -0.1f, 0, 0 );
	glVertex3f( -0.1f, 0, 0.2f );
	glVertex3f( -0.1f, 0.15f, 0.2f );
	glVertex3f( -0.1f, 0.15f, 0 );

	//right foot
	//front
	glVertex3f( 0.2f, 0, 0 );
	glVertex3f( 0.2f, 0, -0.2f );
	glVertex3f( 0.2f, 0.15f, -0.2f );
	glVertex3f( 0.2f, 0.15f, 0 );
	//left side
	glVertex3f( 0.2f, 0, 0 );
	glVertex3f( 0.2f, 0.15f, 0 );
	glVertex3f( -0.1f, 0.15f, 0 );
	glVertex3f( -0.1f, 0, 0 );
	//right side
	glVertex3f( 0.2f, 0, -0.2f );
	glVertex3f( -0.1f, 0, -0.2f );
	glVertex3f( -0.1f, 0.15f, -0.2f );
	glVertex3f( 0.2f, 0.15f, -0.2f );
	//top
	glVertex3f( 0.2f, 0.15f, -0.2f );
	glVertex3f( -0.1f, 0.15f, -0.2f );
	glVertex3f( -0.1f, 0.15f, 0 );
	glVertex3f( 0.2f, 0.15f, 0 );
	//back
	glVertex3f( -0.1f, 0, 0 );
	glVertex3f( -0.1f, 0.15f, 0 );
	glVertex3f( -0.1f, 0.15f, -0.2f );
	glVertex3f( -0.1f, 0, -0.2f );

	glColor3f(1.0f, 1.0f, 1.0f);

	//neck
	//left side
	glVertex3f( 0.1f, 1.5f, 0.1f );
	glVertex3f( 0.1f, 1.65f, 0.1f );
	glVertex3f( -0.1f, 1.65f, 0.1f );
	glVertex3f( -0.1f, 1.5f, 0.1f );
	//front
	glVertex3f( 0.1f, 1.5f, -0.1f );
	glVertex3f( 0.1f, 1.65f, -0.1f );
	glVertex3f( 0.1f, 1.65f, 0.1f );
	glVertex3f( 0.1f, 1.5f, 0.1f );
	//right side
	glVertex3f( 0.1f, 1.5f, -0.1f );
	glVertex3f( -0.1f, 1.5f, -0.1f );
	glVertex3f( -0.1f, 1.65f, -0.1f );
	glVertex3f( 0.1f, 1.65f, -0.1f );
	//back
	glVertex3f( -0.1f, 1.5f, -0.1f );
	glVertex3f( -0.1f, 1.5f, 0.1f );
	glVertex3f( -0.1f, 1.65f, 0.1f );
	glVertex3f( -0.1f, 1.65f, -0.1f );

	glColor3f(0.0f, 0.0f, 0.0f);

	//body
	//left
	glVertex3f( 0.2f, 1.0f, 0.2f );
	glVertex3f( 0.2f, 1.5f, 0.2f );
	glVertex3f( -0.2f, 1.5f, 0.2f );
	glVertex3f( -0.2f, 1.0f, 0.2f );
	//front
	glVertex3f( 0.2f, 1.0f, -0.2f );
	glVertex3f( 0.2f, 1.5f, -0.2f );
	glVertex3f( 0.2f, 1.5f, 0.2f );
	glVertex3f( 0.2f, 1.0f, 0.2f );
	//right
	glVertex3f( 0.2f, 1.0f, -0.2f );
	glVertex3f( -0.2f, 1.0f, -0.2f );
	glVertex3f( -0.2f, 1.5f, -0.2f );
	glVertex3f( 0.2f, 1.5f, -0.2f );
	//back
	glVertex3f( -0.2f, 1.0f, -0.2f );
	glVertex3f( -0.2f, 1.0f, 0.2f );
	glVertex3f( -0.2f, 1.5f, 0.2f );
	glVertex3f( -0.2f, 1.5f, -0.2f );
	//top
	glVertex3f( 0.2f, 1.5f, 0.2f );
	glVertex3f( 0.2f, 1.5f, -0.2f );
	glVertex3f( -0.2f, 1.5f, -0.2f );
	glVertex3f( -0.2f, 1.5f, 0.2f );

	//left arm
	//left side
	glVertex3f( 0.1f, 1.0f, 0.3f );
	glVertex3f( 0.1f, 1.5f, 0.3f );
	glVertex3f( -0.1f, 1.5f, 0.3f );
	glVertex3f( -0.1f, 1.0f, 0.3f );
	//right side
	glVertex3f( 0.1f, 1.0f, 0.2f );
	glVertex3f( -0.1f, 1.0f, 0.2f );
	glVertex3f( -0.1f, 1.5f, 0.2f );
	glVertex3f( 0.1f, 1.5f, 0.2f );
	//front
	glVertex3f( 0.1f, 1.0f, 0.2f );
	glVertex3f( 0.1f, 1.5f, 0.2f );
	glVertex3f( 0.1f, 1.5f, 0.3f );
	glVertex3f( 0.1f, 1.0f, 0.3f );
	//back
	glVertex3f( -0.1f, 1.0f, 0.2f );
	glVertex3f( -0.1f, 1.0f, 0.3f );
	glVertex3f( -0.1f, 1.5f, 0.3f );
	glVertex3f( -0.1f, 1.5f, 0.2f );
	//top
	glVertex3f( -0.1f, 1.5f, 0.3f );
	glVertex3f( 0.1f, 1.5f, 0.3f );
	glVertex3f( 0.1f, 1.5f, 0.2f );
	glVertex3f( -0.1f, 1.5f, 0.2f );

	//right arm
	//right side
	glVertex3f( 0.1f, 1.0f, -0.3f );
	glVertex3f( -0.1f, 1.0f, -0.3f );
	glVertex3f( -0.1f, 1.5f, -0.3f );
	glVertex3f( 0.1f, 1.5f, -0.3f );
	//left side
	glVertex3f( 0.1f, 1.0f, -0.2f );
	glVertex3f( 0.1f, 1.5f, -0.2f );
	glVertex3f( -0.1f, 1.5f, -0.2f );
	glVertex3f( -0.1f, 1.0f, -0.2f );
	//front
	glVertex3f( 0.1f, 1.0f, -0.3f );
	glVertex3f( 0.1f, 1.5f, -0.3f );
	glVertex3f( 0.1f, 1.5f, -0.2f );
	glVertex3f( 0.1f, 1.0f, -0.2f );
	//back
	glVertex3f( -0.1f, 1.0f, -0.3f );
	glVertex3f( -0.1f, 1.0f, -0.2f );
	glVertex3f( -0.1f, 1.5f, -0.2f );
	glVertex3f( -0.1f, 1.5f, -0.3f );
	//top
	glVertex3f( 0.1f, 1.5f, -0.2f );
	glVertex3f( 0.1f, 1.5f, -0.3f );
	glVertex3f( -0.1f, 1.5f, -0.3f );
	glVertex3f( -0.1f, 1.5f, -0.2f );

	glColor3f(0.3f, 0.3f, 1.0f);

	//hips
	//front
	glVertex3f( 0.2f, 0.8f, -0.2f );
	glVertex3f( 0.2f, 1.0f, -0.2f );
	glVertex3f( 0.2f, 1.0f, 0.2f );
	glVertex3f( 0.2f, 0.8f, 0.2f );
	//left
	glVertex3f( 0.2f, 0.8f, 0.2f );
	glVertex3f( 0.2f, 1.0f, 0.2f );
	glVertex3f( -0.2f, 1.0f, 0.2f );
	glVertex3f( -0.2f, 0.8f, 0.2f );
	//back
	glVertex3f( -0.2f, 0.8f, -0.2f );
	glVertex3f( -0.2f, 0.8f, 0.2f );
	glVertex3f( -0.2f, 1.0f, 0.2f );
	glVertex3f( -0.2f, 1.0f, -0.2f );
	//right
	glVertex3f( 0.2f, 0.8f, -0.2f );
	glVertex3f( -0.2f, 0.8f, -0.2f );
	glVertex3f( -0.2f, 1.0f, -0.2f );
	glVertex3f( 0.2f, 1.0f, -0.2f );


	//legs 
	//left leg
	//front
	glVertex3f( 0.05f, 0.15f, 0 );
	glVertex3f( 0.2f, 0.8f, 0 );
	glVertex3f( 0.2f, 0.8f, 0.2f );
	glVertex3f( 0.05f, 0.15f, 0.2f );
	//left
	glVertex3f( 0.05f, 0.15f, 0.2f );
	glVertex3f( 0.2f, 0.8f, 0.2f );
	glVertex3f( -0.2f, 0.8f, 0.2f );
	glVertex3f( -0.1f, 0.15f, 0.2f );
	//right
	glVertex3f( 0.05f, 0.15f, 0 );
	glVertex3f( -0.1f, 0.15f, 0 );
	glVertex3f( -0.2f, 0.8f, 0 );
	glVertex3f( 0.2f, 0.8f, 0 );
	//back
	glVertex3f( -0.1f, 0.15f, 0 );
	glVertex3f( -0.1f, 0.15f, 0.2f );
	glVertex3f( -0.2f, 0.8f, 0.2f );
	glVertex3f( -0.2f, 0.8f, 0 );

	//right leg
	//front
	glVertex3f( 0.05f, 0.15f, 0 );
	glVertex3f( 0.05f, 0.15f, -0.2f );
	glVertex3f( 0.2f, 0.8f, -0.2f );
	glVertex3f( 0.2f, 0.8f, 0 );
	//back
	glVertex3f( -0.1f, 0.15f, 0 );
	glVertex3f( -0.2f, 0.8f, 0 );
	glVertex3f( -0.2f, 0.8f, -0.2f );
	glVertex3f( -0.1f, 0.15f, -0.2f );
	//right
	glVertex3f( 0.05f, 0.15f, -0.2f );
	glVertex3f( -0.1f, 0.15f, -0.2f );
	glVertex3f( -0.2f, 0.8f, -0.2f );
	glVertex3f( 0.2f, 0.8f, -0.2f );
	//left
	glVertex3f( 0.05f, 0.15f, 0 );
	glVertex3f( 0.2f, 0.8f, 0 );
	glVertex3f( -0.2f, 0.8f, 0 );
	glVertex3f( -0.1f, 0.15f, 0 );

	glColor3f(1.0f, 1.0f, 1.0f);

	//left hand
	//front
	glVertex3f( 0.1f, 0.8f, 0.2f );
	glVertex3f( 0.1f, 1.0f, 0.2f );
	glVertex3f( 0.1f, 1.0f, 0.3f );
	glVertex3f( 0.1f, 0.8f, 0.3f );
	//left side
	glVertex3f( 0.1f, 0.8f, 0.3f );
	glVertex3f( 0.1f, 1.0f, 0.3f );
	glVertex3f( -0.1f, 1.0f, 0.3f );
	glVertex3f( -0.1f, 0.8f, 0.3f );
	//right side
	glVertex3f( 0.1f, 0.8f, 0.2f );
	glVertex3f( 0.1f, 1.0f, 0.2f );
	glVertex3f( -0.1f, 1.0f, 0.2f );
	glVertex3f( -0.1f, 0.8f, 0.2f );
	//back
	glVertex3f( -0.1f, 0.8f, 0.2f );
	glVertex3f( -0.1f, 0.8f, 0.3f );
	glVertex3f( -0.1f, 1.0f, 0.3f );
	glVertex3f( -0.1f, 1.0f, 0.2f );
	//bottom
	glVertex3f( 0.1f, 0.8f, 0.3f );
	glVertex3f( -0.1f, 0.8f, 0.3f );
	glVertex3f( -0.1f, 0.8f, 0.2f );
	glVertex3f( 0.1f, 0.8f, 0.2f );

	//right hand
	//front
	glVertex3f( 0.1f, 0.8f, -0.3f );
	glVertex3f( 0.1f, 1.0f, -0.3f );
	glVertex3f( 0.1f, 1.0f, -0.2f );
	glVertex3f( 0.1f, 0.8f, -0.2f );
	//back
	glVertex3f( -0.1f, 0.8f, -0.3f );
	glVertex3f( -0.1f, 0.8f, -0.2f );
	glVertex3f( -0.1f, 1.0f, -0.2f );
	glVertex3f( -0.1f, 1.0f, -0.3f );
	//left side
	glVertex3f( 0.1f, 0.8f, -0.2f );
	glVertex3f( 0.1f, 1.0f, -0.2f );
	glVertex3f( -0.1f, 1.0f, -0.2f );
	glVertex3f( -0.1f, 0.8f, -0.2f );
	//right side
	glVertex3f( 0.1f, 0.8f, -0.3f );
	glVertex3f( -0.1f, 0.8f, -0.3f );
	glVertex3f( -0.1f, 1.0f, -0.3f );
	glVertex3f( 0.1f, 1.0f, -0.3f );
	//bottom
	glVertex3f( 0.1f, 0.8f, -0.2f );
	glVertex3f( -0.1f, 0.8f, -0.2f );
	glVertex3f( -0.1f, 0.8f, -0.3f );
	glVertex3f( 0.1f, 0.8f, -0.3f );

	glEnd();
	*/

/*
	glBegin(GL_LINES);
	glColor3f( 0, 0, 0 );

	//left foot
	//front
	glVertex3f( 0.2f, 0, 0 );
	glVertex3f( 0.2f, 0.15f, 0 );
	glVertex3f( 0.2f, 0.15f, 0.2f );
	glVertex3f( 0.2f, 0, 0.2f );

	//left-side
	glVertex3f( 0.2f, 0, 0.2f );
	glVertex3f( 0.2f, 0.15f, 0.2f );
	glVertex3f( -0.1f, 0.15f, 0.2f );
	glVertex3f( -0.1f, 0, 0.2f );
	//right side
	glVertex3f( 0.2f, 0, 0 );
	glVertex3f( -0.1f, 0, 0 );
	glVertex3f( -0.1f, 0.15f, 0 );
	glVertex3f( 0.2f, 0.15f, 0 );
	//top
	glVertex3f( 0.2f, 0.15f, 0.2f );
	glVertex3f( 0.2f, 0.15f, 0 );
	glVertex3f( -0.1f, 0.15f, 0 );
	glVertex3f( -0.1f, 0.15f, 0.2f );
	//back
	glVertex3f( -0.1f, 0, 0 );
	glVertex3f( -0.1f, 0, 0.2f );
	glVertex3f( -0.1f, 0.15f, 0.2f );
	glVertex3f( -0.1f, 0.15f, 0 );

	//right foot
	//front
	glVertex3f( 0.2f, 0, 0 );
	glVertex3f( 0.2f, 0, -0.2f );
	glVertex3f( 0.2f, 0.15f, -0.2f );
	glVertex3f( 0.2f, 0.15f, 0 );
	//left side
	glVertex3f( 0.2f, 0, 0 );
	glVertex3f( 0.2f, 0.15f, 0 );
	glVertex3f( -0.1f, 0.15f, 0 );
	glVertex3f( -0.1f, 0, 0 );
	//right side
	glVertex3f( 0.2f, 0, -0.2f );
	glVertex3f( -0.1f, 0, -0.2f );
	glVertex3f( -0.1f, 0.15f, -0.2f );
	glVertex3f( 0.2f, 0.15f, -0.2f );
	//top
	glVertex3f( 0.2f, 0.15f, -0.2f );
	glVertex3f( -0.1f, 0.15f, -0.2f );
	glVertex3f( -0.1f, 0.15f, 0 );
	glVertex3f( 0.2f, 0.15f, 0 );
	//back
	glVertex3f( -0.1f, 0, 0 );
	glVertex3f( -0.1f, 0.15f, 0 );
	glVertex3f( -0.1f, 0.15f, -0.2f );
	glVertex3f( -0.1f, 0, -0.2f );

	//legs 
	//left leg
	//front
	glVertex3f( 0.05f, 0.15f, 0 );
	glVertex3f( 0.2f, 0.8f, 0 );
	glVertex3f( 0.2f, 0.8f, 0.2f );
	glVertex3f( 0.05f, 0.15f, 0.2f );
	//left
	glVertex3f( 0.05f, 0.15f, 0.2f );
	glVertex3f( 0.2f, 0.8f, 0.2f );
	glVertex3f( -0.2f, 0.8f, 0.2f );
	glVertex3f( -0.1f, 0.15f, 0.2f );
	//right
	glVertex3f( 0.05f, 0.15f, 0 );
	glVertex3f( -0.1f, 0.15f, 0 );
	glVertex3f( -0.2f, 0.8f, 0 );
	glVertex3f( 0.2f, 0.8f, 0 );
	//back
	glVertex3f( -0.1f, 0.15f, 0 );
	glVertex3f( -0.1f, 0.15f, 0.2f );
	glVertex3f( -0.2f, 0.8f, 0.2f );
	glVertex3f( -0.2f, 0.8f, 0 );

	//right leg
	//front
	glVertex3f( 0.05f, 0.15f, 0 );
	glVertex3f( 0.05f, 0.15f, -0.2f );
	glVertex3f( 0.2f, 0.8f, -0.2f );
	glVertex3f( 0.2f, 0.8f, 0 );
	//back
	glVertex3f( -0.1f, 0.15f, 0 );
	glVertex3f( -0.2f, 0.8f, 0 );
	glVertex3f( -0.2f, 0.8f, -0.2f );
	glVertex3f( -0.1f, 0.15f, -0.2f );
	//right
	glVertex3f( 0.05f, 0.15f, -0.2f );
	glVertex3f( -0.1f, 0.15f, -0.2f );
	glVertex3f( -0.2f, 0.8f, -0.2f );
	glVertex3f( 0.2f, 0.8f, -0.2f );
	//left
	glVertex3f( 0.05f, 0.15f, 0 );
	glVertex3f( 0.2f, 0.8f, 0 );
	glVertex3f( -0.2f, 0.8f, 0 );
	glVertex3f( -0.1f, 0.15f, 0 );

	glEnd();
	*/
	/*

	glBegin( GL_TRIANGLES );

	//NOSE
	glVertex3f( 0.20f, 1.8f, 0 );
	glVertex3f( 0.18f, 1.78f, 0.02f );
	glVertex3f( 0.23f, 1.78f, 0 );


	glEnd();
	*/

	/*
	//head
	glPushMatrix();

	glTranslatef( 0, 1.8f, 0 );
	glutSolidSphere( 0.2f, 100, 100 );
	glPopMatrix();

	//eyes
	glColor3f(0.0f, 0.0f, 0.0f);
	glPushMatrix();
	glTranslatef (0.18f, 1.85f, 0.05f);
	glutSolidSphere(0.035 , 5, 5);
	glPopMatrix();

	glPushMatrix();
	glTranslatef (0.18f, 1.85f, -0.05f);
	glutSolidSphere(0.035 , 5, 5);
	glPopMatrix();

	//nose
	glColor3f(1.0f, 1.0f, 1.0f);
	glPushMatrix();
	glTranslatef(0.2f, 1.8f, 0);
	glutSolidSphere(0.035 , 5, 5);
	glPopMatrix();

	glColor3f(0.95f, 1.0f, 0.95f);
	glPushMatrix();
	glTranslatef(0.2f, 1.8f, 0);
	glutWireSphere( 0.035, 5, 5 );
	glPopMatrix();
	*/
/*
	//code for truck
	glColor3f(0.6f, 0.3f, 0.3f);

	glBegin(GL_QUADS);
	// roof
	glColor3f(0.6f, 0.3f, 0.3f);
	glVertex3f(0.3f, 2.0f, 0.9f);
	glVertex3f(0.3f, 2.0f, -0.9f);
	glVertex3f(-0.6f, 2.0f, -0.9f);
	glVertex3f(-0.6f, 2.0f, 0.9f);

	// windshield
	glColor3f(0.3f, 0.3f, 0.5f);
	glVertex3f(0.6f, 1.2f, 0.9f);
	glVertex3f(0.6f, 1.2f, -0.9f);
	glVertex3f(0.3f, 2.0f, -0.9f);
	glVertex3f(0.3f, 2.0f, 0.9f);

	// cab sides
	glVertex3f(0.6f, 1.2f, 0.9f);
	glVertex3f(0.3f, 2.0f, 0.9f);
	glVertex3f(-0.6f, 2.0f, 0.9f);
	glVertex3f(-0.6f, 1.2f, 0.9f);

	glVertex3f(0.6f, 1.2f, -0.9f);
	glVertex3f(-0.6f, 1.2f, -0.9f);
	glVertex3f(-0.6f, 2.0f, -0.9f);
	glVertex3f(0.3f, 2.0f, -0.9f);

	// back window
	glVertex3f(-0.6f, 1.2f, 0.9f);
	glVertex3f(-0.6f, 2.0f, 0.9f);
	glVertex3f(-0.6f, 2.0f, -0.9f);
	glVertex3f(-0.6f, 1.2f, -0.9f);

	// bed
	glColor3f(0.6f, 0.3f, 0.3f);
	glVertex3f(-0.6f, 1.2f, 0.9f);
	glVertex3f(-0.6f, 1.2f, -0.9f);
	glVertex3f(-2.3f, 1.2f, -0.9f);
	glVertex3f(-2.3f, 1.2f, 0.9f);

	// hood
	glColor3f(0.6f, 0.2f, 0.2f);
	glVertex3f(1.7f, 1.2f, 0.9f);
	glVertex3f(1.7f, 1.2f, -0.9f);
	glVertex3f(0.6f, 1.2f, -0.9f);
	glVertex3f(0.6f, 1.2f, 0.9f);

	glVertex3f(2.0f, 0.9f, 0.6f);
	glVertex3f(2.0f, 0.9f, -0.6f);
	glVertex3f(1.7f, 1.2f, -0.9f);
	glVertex3f(1.7f, 1.2f, 0.9f);

	// grill
	glVertex3f(2.0f, 0.3f, 0.6f);
	glVertex3f(2.0f, 0.3f, -0.6f);
	glVertex3f(2.0f, 0.9f, -0.6f);
	glVertex3f(2.0f, 0.9f, 0.6f);

	// front corners
	glColor3f(0.8f, 0.1f, 0.1f);
	glVertex3f(1.7f, 0.3f, 0.9f);
	glVertex3f(2.0f, 0.3f, 0.6f);
	glVertex3f(2.0f, 0.9f, 0.6f);
	glVertex3f(1.7f, 1.2f, 0.9f);

	glVertex3f(1.7f, 0.3f, -0.9f);
	glVertex3f(1.7f, 1.2f, -0.9f);
	glVertex3f(2.0f, 0.9f, -0.6f);
	glVertex3f(2.0f, 0.3f, -0.6f);

	// sides
	glColor3f(0.6f, 0.3f, 0.3f);
	glVertex3f(1.7f, 0.3f, 0.9f);
	glVertex3f(1.7f, 1.2f, 0.9f);
	glVertex3f(-2.3f, 1.2f, 0.9f);
	glVertex3f(-2.3f, 0.3f, 0.9f);

	glVertex3f(1.7f, 0.3f, -0.9f);
	glVertex3f(-2.3f, 0.3f, -0.9f);
	glVertex3f(-2.3f, 1.2f, -0.9f);
	glVertex3f(1.7f, 1.2f, -0.9f);

	// back
	glColor3f(0.6f, 0.2f, 0.2f);
	glVertex3f(-2.3f, 0.3f, 0.9f);
	glVertex3f(-2.3f, 1.2f, 0.9f);
	glVertex3f(-2.3f, 1.2f, -0.9f);
	glVertex3f(-2.3f, 0.3f, -0.9f);

	glEnd();

	glColor3f(0.2f, 0.2f, 0.2f);

	const float kWheelRadius = 0.45f;
	// create the wheels
	glBegin(GL_TRIANGLE_FAN);
	glVertex3f(0.9f, 0.3f, 1.1f);
	for (int i = 0; i <= 8; ++i)
	{
		float x = cos(kPi / 4.0f * i) * kWheelRadius + 0.9f;
		float y = sin(kPi / 4.0f * i) * kWheelRadius + 0.3f;
		glVertex3f(x, y, 1.1f);
	}
	glEnd();

	glBegin(GL_TRIANGLE_FAN);
	glVertex3f(-1.5f, 0.3f, 1.1f);
	for (int i = 0; i <= 8; ++i)
	{
		float x = cos(kPi / 4.0f * i) * kWheelRadius + -1.5f;
		float y = sin(kPi / 4.0f * i) * kWheelRadius + 0.3f;
		glVertex3f(x, y, 1.1f);
	}
	glEnd();

	glBegin(GL_TRIANGLE_FAN);
	glVertex3f(0.9f, 0.3f, -1.1f);
	for (int i = 8; i >= 0; --i)
	{
		float x = cos(kPi / 4.0f * i) * kWheelRadius + 0.9f;
		float y = sin(kPi / 4.0f * i) * kWheelRadius + 0.3f;
		glVertex3f(x, y, -1.1f);
	}
	glEnd();

	glBegin(GL_TRIANGLE_FAN);
	glVertex3f(-1.5f, 0.3f, -1.1f);
	for (int i = 8; i >= 0; --i)
	{
		float x = cos(kPi / 4.0f * i) * kWheelRadius + -1.5f;
		float y = sin(kPi / 4.0f * i) * kWheelRadius + 0.3f;
		glVertex3f(x, y, -1.1f);
	}
	glEnd();
	*/
}

